/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {
    mysql: {
      // 单数据库信息配置
      client: {
        // host
        host: 'localhost',
        // 端口号
        port: '3306',
        // 用户名
        user: 'maozai',
        // 密码
        password: '1q2w3e4r',
        // 数据库名
        database: 'creation',
      },
      // 是否加载到 app 上，默认开启
      app: true,
      // 是否加载到 agent 上，默认关闭
      agent: false,
    },

    security: {
      csrf: {
        enable: false,
      },
    }
  };

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1636589438929_8302';

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };
  //配置支付信息
  config.payConfig = {
      // 沙箱环境的appId
      appId: '2021000118660489',
      // 私钥
      privateKey: 'MIIEowIBAAKCAQEAs/soZ63mIuHXomAdemhUgtCYo8PaPdqZejCre/8uL0RBh4vuyg+qKRMsehApc/CC4hw+PFjTU2WmTxcW8oyaTL4mUMSX86HxEGR5sVXVGsMddVY3hGGBPOyFDxv5vpfdHDgoSI2WEfKNiCDJNgCSxeaYna3HwQWfmAq6jqIrDGOg0T85Ert2L3bJAXLGUrg9R2kJCjRS940+hBS/ezIJiAyb1edfWjrc8A2pi3wJr7pnBGOxB3KjhxLn4kTz6zFH1dLyTDyl6vqnX0YVdxOwQL8NWRZHlwmJcbc6v2IU7PrbZzsMyhg2Q5mXGSsb2mZiCIPTl+dBE70uIDkeJZOR9wIDAQABAoIBAFBXck7t4sh5di+mpiIJRohqo2ifOeHYniBcb4BXhf9VgccHIR4T5gqV44nNgyOdHl/e6a04nYUh4B54GSdGum49h48QYyA/jwOZRnVx8kITDShex0OR3wYaMr9u5oo88lfxfZH9mhsC4kj9EbTIhrxO1pu0gnHYl8hgKa0YGQ1a/4PldmKIAgKiTTSZPYsppY7zFamBjGVZiIsXaYnOLl4VnDlqMJdf0IGqC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bqH+KpR2CIcnYFNpR7XKtbMZV5geEkVPu6lLH1YxQJGhjUACAZXLCAzpNYKxnVNuDGay88iEx/1a2H/Gk0ClMC+ZxAgKLC3OBENfiVFpbtepzuP8p2Cx4eVj7/3hf8BDKg7Smt7e0RWfP3qH22pE1ZlNMtNSDTMRYb8FIX5UqJryodZ+/4NXlxbCwO4Dl8tbKDDp30O4Q2ys0vG29sm+uosxLDtfxRYO5hmvmilcR3b7a9kXhkGozd4p1iJ4B47CQKgnYZGdIyojBgnEDX2R6pUPzntUXTCh5bH8nKpbCNXuI0FGq/qEKsPn0g8QoDJZSxwIDAQAB', // 支付宝公钥（不是应用公钥）
      // 签名类型
      signType: 'RSA2', // RSA2
      gateway: 'https://openapi.alipaydev.com/gateway.do', // 网关地址
      timeout: 5000, // 网关超时时间
      camelcase: true // 是否把网关返回的下划线 key 转换为驼峰写法
    };
    return {
      ...config,
      ...userConfig,
    };
};